
import Pure from 'pure-frontend';

/* SOURCE-CODE-START */

"use strict";

Pure.app.viewMain('example2-view', function (scope, view) {
  var urlParams = view.getUrlParams();
  var id = urlParams.id;

  var queryParams = {
    id: id
  };

  view.callService('api/example/getDetail', queryParams)
    .waitResult(function (result, textStatus, jqXHR) {
      var model = view.getDataModel();
      model.setData('*', result.data);
    });

  view.$ui('backBtn').on('click', function () {
    Pure.app.popView('app/example2/search');
  });

});

/* SOURCE-CODE-END */
